//
//  dict.h
//  xxxxxx
//
//  Created by vence on 14-5-30.
//  Copyright (c) 2014年 vence. All rights reserved.
//

#ifndef _DICT_H

#define _DICT_H

#define MAXCHILD 256//ascii码有256个字符，故每棵树的子节点最多有256个
#define MAXLEN 256//单词最长为256

typedef struct
{
    int num;
    struct TrieNode *next[MAXCHILD];
}TrieNode;


TrieNode * trie_init();

TrieNode * trie_lookup( TrieNode *,char *,int);

TrieNode * trie_insert(TrieNode *, char *,int);

TrieNode * trie_lookup_c( TrieNode *, char);

TrieNode * trie_insert_c(TrieNode *, char);

TrieNode * trie_insert_i(TrieNode *node, unsigned idx);

void trie_destroy(TrieNode *);

extern int trie_count;

#endif